package ycl.common.result;

import lombok.Getter;

/**
 * @author YCL
 * @date 2022/01/24 16:11:57
 */
@Getter
public enum REnum {
	/**
	 * ---------------------常用---------------------
	 */
	USED_OK(200, "请求成功"),
	USED_UNAUTHORIZED(401, "未登录或登录过期"),
	USED_PAYMENT_REQUIRED(402, "权限不足"),
	USED_FORBIDDEN(403, "禁止访问此页面"),
	USED_NOT_FOUND(404, "页面未找到"),
	USED_SERVER_ERROR(500, "服务器异常"),
	USED_BAD_GATEWAY(502, "服务器无响应"),
	USED_SERVICE_UNAVAILABLE(503, "服务未开放"),
	USED_GATEWAY_TIMEOUT(504, "网关超时"),

	/**
	 * ---------------------自定义---------------------
	 */
	CUSTOM_ACCOUNT_PASSWORD_WRONG(500, "账号或密码错误"),
	CUSTOM_NOT_KNOW_EXCEPTION(1000, "未知异常, 请联系管理员"),
	CUSTOM_TEMP_PASSWORD(1001, "临时密码"),
	CUSTOM_INNER_ERROR(1002, "内部错误, 请联系管理员"),
	CUSTOM_SERVER_REJECT(1011, "服务器拒绝操作"),
	CUSTOM_MOBILE_REGISTER(2001, "手机号已被注册"),
	CUSTOM_VERIFY_ID_CARD_NOT_PASS(2101, "身份证校验不通过"),
	CUSTOM_FILE_UPLOAD_EXCEPTION(2201, "文件上传异常"),


	/**
	 * ---------------------不常用---------------------
	 */
	CONTINUE(100, "请求成功一部分, 请继续发送信息"),
	SWITCHING_PROTOCOLS(101, "服务器切换协议"),
	CREATED(201, "完整请求, 创建新资源"),
	ACCEPTED(202, "请求被处理, 但处理不完整"),
	NON_AUTHORITATIVE_INFORMATION(203, ""),
	NO_CONTENT(204, ""),
	RESET_CONTENT(205, ""),
	PARTIAL_CONTENT(206, ""),
	MULTIPLE_CHOICES(300, "链接列表, 用户可选择其中一个并进入, 最多5个"),
	MOVED_PERMANENTLY(301, "页面转移到新url"),
	MOVED_TEMPORARILY(302, "页面临时转移到新url"),
	FOUND(302, "页面可在其他url中找到"),
	SEE_OTHER(303, ""),
	NOT_MODIFIED(304, ""),
	USE_PROXY(305, ""),
	TEMPORARY_REDIRECT(307, ""),
	BAD_REQUEST(400, "服务器无法处理"),

	METHOD_NOT_ALLOWED(405, "方法访问不规范"),
	NOT_ACCEPTABLE(406, "响应内容不被客户端接受"),
	PROXY_AUTHENTICATION_REQUIRED(407, "请使用代理服务器验证"),
	REQUEST_TIMEOUT(408, "请求超时"),
	CONFLICT(409, "请求冲突"),
	GONE(410, "页面无法使用"),
	LENGTH_REQUIRED(411, "无法处理不带Content-Length的请求"),
	PRECONDITION_FAILED(412, ""),
	REQUEST_ENTITY_TOO_LARGE(413, "请求体过大"),
	REQUEST_URI_TOO_LONG(414, "url太长"),
	UNSUPPORTED_MEDIA_TYPE(415, "媒体类型不支持"),
	REQUESTED_RANGE_NOT_SATISFIABLE(416, ""),
	EXPECTATION_FAILED(417, ""),

	NOT_IMPLEMENTED(501, ""),
	HTTP_VERSION_NOT_SUPPORTED(505, "HTTP协议不支持"),
	;

	public final int code;
	public final String msg;


	REnum(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}
}
